package com.dhcc.wb.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import org.json.JSONObject;



public class DateUtil {

	// 增加或减少天数
    public static String addDay(Date date, int num) {
     Calendar startDT = Calendar.getInstance();
     startDT.setTime(date);
     startDT.add(Calendar.DAY_OF_MONTH, num);
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
     return sdf.format(startDT.getTime());
    }
	
    // 增加或减少天数
    public static String getDate() {
    	JSONObject json = new JSONObject();
//		json.put("begin_date", DateUtil.addDay(new Date(), -2));
//		json.put("end_date", DateUtil.addDay(new Date(), -1));
		
		json.put("begin_date", "2019-03-25");
		json.put("end_date", "2019-03-31");
		
		return json.toString();
    }
	
}
